Optimal. Leaf size=170 \[ -\frac {a \left (a^2-6 b^2\right ) \cos (c+d x)}{d}+\frac {b \left (6 a^2-b^2\right ) \cos ^2(c+d x)}{2 d}+\frac {a \left (2 a^2-3 b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {3 a^2 b \cos ^4(c+d x)}{4 d}-\frac {a^3 \cos ^5(c+d x)}{5 d}-\frac {b \left (3 a^2-2 b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 170, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3957, 2916, 12,
962} \begin {gather*} -\frac {a^3 \cos ^5(c+d x)}{5 d}+\frac {a \left (2 a^2-3 b^2\right ) \cos ^3(c+d x)}{3 d}+\frac {b \left (6 a^2-b^2\right ) \cos ^2(c+d x)}{2 d}-\frac {a \left (a^2-6 b^2\right ) \cos (c+d x)}{d}-\frac {b \left (3 a^2-2 b^2\right ) \log (\cos (c+d x))}{d}-\frac {3 a^2 b \cos ^4(c+d x)}{4 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 962
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^3 \sin ^5(c+d x) \, dx &=-\int (-b-a \cos (c+d x))^3 \sin ^2(c+d x) \tan ^3(c+d x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {a^3 (-b+x)^3 \left (a^2-x^2\right )^2}{x^3} \, dx,x,-a \cos (c+d x)\right )}{a^5 d}\\ &=\frac {\text {Subst}\left (\int \frac {(-b+x)^3 \left (a^2-x^2\right )^2}{x^3} \, dx,x,-a \cos (c+d x)\right )}{a^2 d}\\ &=\frac {\text {Subst}\left (\int \left (a^4 \left (1-\frac {6 b^2}{a^2}\right )-\frac {a^4 b^3}{x^3}+\frac {3 a^4 b^2}{x^2}+\frac {-3 a^4 b+2 a^2 b^3}{x}-b \left (-6 a^2+b^2\right ) x-\left (2 a^2-3 b^2\right ) x^2-3 b x^3+x^4\right ) \, dx,x,-a \cos (c+d x)\right )}{a^2 d}\\ &=-\frac {a \left (a^2-6 b^2\right ) \cos (c+d x)}{d}+\frac {b \left (6 a^2-b^2\right ) \cos ^2(c+d x)}{2 d}+\frac {a \left (2 a^2-3 b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {3 a^2 b \cos ^4(c+d x)}{4 d}-\frac {a^3 \cos ^5(c+d x)}{5 d}-\frac {b \left (3 a^2-2 b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.41, size = 154, normalized size = 0.91 \begin {gather*} \frac {-60 a \left (5 a^2-42 b^2\right ) \cos (c+d x)+60 \left (9 a^2 b-2 b^3\right ) \cos (2 (c+d x))+50 a^3 \cos (3 (c+d x))-120 a b^2 \cos (3 (c+d x))-45 a^2 b \cos (4 (c+d x))-6 a^3 \cos (5 (c+d x))-1440 a^2 b \log (\cos (c+d x))+960 b^3 \log (\cos (c+d x))+1440 a b^2 \sec (c+d x)+240 b^3 \sec ^2(c+d x)}{480 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 174, normalized size = 1.02
method | result | size |
derivativedivides | \(\frac {b^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )+3 b^{2} a \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+3 b \,a^{2} \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-\frac {a^{3} \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}}{d}\) | \(174\) |
default | \(\frac {b^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )+3 b^{2} a \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+3 b \,a^{2} \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-\frac {a^{3} \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}}{d}\) | \(174\) |
norman | \(\frac {\frac {\left (16 a^{3}+24 b \,a^{2}-48 b^{2} a +16 b^{3}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {16 a^{3}-240 b^{2} a}{15 d}-\frac {\left (6 b \,a^{2}-4 b^{3}\right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (18 b \,a^{2}-12 b^{3}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (16 a^{3}+30 b \,a^{2}-240 b^{2} a -20 b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {\left (16 a^{3}+270 b \,a^{2}-240 b^{2} a -180 b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}-\frac {\left (32 a^{3}-72 b \,a^{2}+96 b^{2} a -48 b^{3}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}+\frac {b \left (3 a^{2}-2 b^{2}\right ) \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {b \left (3 a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {b \left (3 a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(350\) |
risch | \(3 i a^{2} b x -2 i b^{3} x +\frac {5 a^{3} {\mathrm e}^{3 i \left (d x +c \right )}}{96 d}-\frac {{\mathrm e}^{3 i \left (d x +c \right )} b^{2} a}{8 d}+\frac {9 \,{\mathrm e}^{2 i \left (d x +c \right )} b \,a^{2}}{16 d}-\frac {{\mathrm e}^{2 i \left (d x +c \right )} b^{3}}{8 d}-\frac {5 a^{3} {\mathrm e}^{i \left (d x +c \right )}}{16 d}+\frac {21 \,{\mathrm e}^{i \left (d x +c \right )} b^{2} a}{8 d}-\frac {5 a^{3} {\mathrm e}^{-i \left (d x +c \right )}}{16 d}+\frac {21 \,{\mathrm e}^{-i \left (d x +c \right )} b^{2} a}{8 d}+\frac {9 \,{\mathrm e}^{-2 i \left (d x +c \right )} b \,a^{2}}{16 d}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )} b^{3}}{8 d}+\frac {5 a^{3} {\mathrm e}^{-3 i \left (d x +c \right )}}{96 d}-\frac {{\mathrm e}^{-3 i \left (d x +c \right )} b^{2} a}{8 d}+\frac {6 i b \,a^{2} c}{d}-\frac {4 i b^{3} c}{d}+\frac {2 b^{2} \left (3 a \,{\mathrm e}^{3 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 \,{\mathrm e}^{i \left (d x +c \right )} a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{d}+\frac {2 b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}-\frac {a^{3} \cos \left (5 d x +5 c \right )}{80 d}-\frac {3 b \,a^{2} \cos \left (4 d x +4 c \right )}{32 d}\) | \(381\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 142, normalized size = 0.84 \begin {gather*} -\frac {12 \, a^{3} \cos \left (d x + c\right )^{5} + 45 \, a^{2} b \cos \left (d x + c\right )^{4} - 20 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} - 30 \, {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 60 \, {\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right ) + 60 \, {\left (3 \, a^{2} b - 2 \, b^{3}\right )} \log \left (\cos \left (d x + c\right )\right ) - \frac {30 \, {\left (6 \, a b^{2} \cos \left (d x + c\right ) + b^{3}\right )}}{\cos \left (d x + c\right )^{2}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.22, size = 175, normalized size = 1.03 \begin {gather*} -\frac {96 \, a^{3} \cos \left (d x + c\right )^{7} + 360 \, a^{2} b \cos \left (d x + c\right )^{6} - 160 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} - 240 \, {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{4} - 1440 \, a b^{2} \cos \left (d x + c\right ) + 480 \, {\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 480 \, {\left (3 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\cos \left (d x + c\right )\right ) - 240 \, b^{3} + 15 \, {\left (39 \, a^{2} b - 8 \, b^{3}\right )} \cos \left (d x + c\right )^{2}}{480 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 695 vs.
\(2 (160) = 320\).
time = 0.60, size = 695, normalized size = 4.09 \begin {gather*} \frac {60 \, {\left (3 \, a^{2} b - 2 \, b^{3}\right )} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 60 \, {\left (3 \, a^{2} b - 2 \, b^{3}\right )} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {30 \, {\left (9 \, a^{2} b + 12 \, a b^{2} - 6 \, b^{3} + \frac {18 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {12 \, a b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {16 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {9 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {6 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{2}} + \frac {64 \, a^{3} + 411 \, a^{2} b - 600 \, a b^{2} - 274 \, b^{3} - \frac {320 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2415 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2640 \, a b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {1490 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {640 \, a^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {5910 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {3840 \, a b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {3100 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {5910 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {2160 \, a b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3100 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {2415 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {360 \, a b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {1490 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {411 \, a^{2} b {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {274 \, b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1\right )}^{5}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.96, size = 143, normalized size = 0.84 \begin {gather*} -\frac {{\cos \left (c+d\,x\right )}^3\,\left (a\,b^2-\frac {2\,a^3}{3}\right )-{\cos \left (c+d\,x\right )}^2\,\left (3\,a^2\,b-\frac {b^3}{2}\right )+\ln \left (\cos \left (c+d\,x\right )\right )\,\left (3\,a^2\,b-2\,b^3\right )-\frac {\frac {b^3}{2}+3\,a\,\cos \left (c+d\,x\right )\,b^2}{{\cos \left (c+d\,x\right )}^2}-\cos \left (c+d\,x\right )\,\left (6\,a\,b^2-a^3\right )+\frac {a^3\,{\cos \left (c+d\,x\right )}^5}{5}+\frac {3\,a^2\,b\,{\cos \left (c+d\,x\right )}^4}{4}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________